﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
///GridViewTxtTemplate 的摘要说明
/// </summary>
public class GridViewTxtTemplate : ITemplate
{
    private string controlId = null;
    private string dataField = null;
    private Type type;

    public GridViewTxtTemplate(string controlId, Type type, string dataField)
    {
        this.controlId = controlId;
        this.type = type;
        this.dataField = dataField;
    }

    public void InstantiateIn(System.Web.UI.Control container)
    {
        
         TextBox textBox = new TextBox();
         textBox.ID = controlId;
         textBox.DataBinding += new EventHandler(control_DataBinding);
         container.Controls.Add(textBox);
    }
    private void control_DataBinding(object sender, EventArgs e)
    {
        GridViewRow container;
        TextBox textBox = (TextBox)sender;
        container = (GridViewRow)textBox.NamingContainer;
    }
}